package com.wowangz.cms.systemmanage.handautotask.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.wowangz.cms.syscore.autotask.pojo.Autotask;
import com.wowangz.cms.syscore.exception.ServiceException;
import com.wowangz.cms.syscore.service.BaseService;

public class HandAutoTaskService extends BaseService{
	
	private Logger logger = LoggerFactory.getLogger(HandAutoTaskService.class);
	
	/**
	 * 分页查询总条数
	 * @param map
	 * @return
	 */
	public long findResultCount(Map<String, Object> map) throws ServiceException {
		logger.info("inter findResultCount method........");
		return this.getSqlSession().selectOne("handAutoTask.queryHandAutoTaskCount", map);
	}
	/**
	 * 查询记录集合
	 * @param map
	 * @return
	 */
	public List<Autotask> findResultList(Map<String, Object> map) throws ServiceException {
		logger.info("inter findResultList method........");
		return this.getSqlSession().selectList("handAutoTask.queryHandAutoTaskoPage", map);
	}
	/*************
	 * 根据id获得所有自动任务
	 * @param id
	 * @return
	 * @throws ServiceException
	 */
	public Autotask queryHandAutoTaskByID(Long id) throws ServiceException {
		logger.info("inter queryHandAutoTaskByID method........");
		Map<String, Object> map=new HashMap<String, Object>();
		map.put("id",id);
		return this.getSqlSession().selectOne("handAutoTask.queryHandAutoTaskByID",map);
	}
	
	
	/**
	 * 分页查询总条数
	 * @param map
	 * @return
	 */
	public long queryAutoTaskResultCount(Map<String, Object> map) throws ServiceException {
		logger.info("inter queryAutoTaskResultCount method........");
		return this.getSqlSession().selectOne("handAutoTask.queryAutoTaskResultCount", map);
	}
	/**
	 * 查询记录集合
	 * @param map
	 * @return
	 */
	public List<Autotask> queryAutoTaskResultPage(Map<String, Object> map) throws ServiceException {
		logger.info("inter queryAutoTaskResultPage method........");
		return this.getSqlSession().selectList("handAutoTask.queryAutoTaskResultPage", map);
	}
}
